package com.ych.controller;

import com.ych.beans.Message;
import com.ych.service.PermService;

import com.ych.util.logUtil.AddLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PermController {
    @Autowired
    PermService service;
    @AddLog
    @PostMapping("/role/perm/{role_id}/{perm_id}")
    public Message addRolePerm(@PathVariable Integer role_id, @PathVariable Integer perm_id){
        return service.addPermForRole(role_id,perm_id);
    }

    @AddLog
    @GetMapping("/perms")
    public Message selectPerms(){
        return service.selectPerms();
    }
}
